﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using XRERP.utils;


namespace XRERP.Controllers
{
    [AllowAnonymous]
    public class LoginController : Controller
    {
        // GET: Login
        public ActionResult Index()
        {
            return View();
        }


        /// <summary>
        /// AJAX登录
        /// </summary>
        /// <returns></returns>
        public ActionResult Logon()
        {
            return Json("");
        }

        /// <summary>
        /// 输出验证码文件
        /// </summary>
        /// <returns></returns>
        public ActionResult GetValidateCode()
        {
            ValidateGraphic vg = new ValidateGraphic();
            string code = vg.CreateValidateCode(4);
            Session["ValidatorCode"] = code;
            byte[] graphic = vg.CreateValidateGraphic(code);
            return File(graphic, @"image/jpeg");
        }

    }
}